package com.jk.controller;

import com.jk.pojo.InhabitantBean;
import com.jk.service.InhabitantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @ClassName InhabitantController
 * @Descripttion TODO 居民表的Controller
 * @Author DELL
 * @Date 2022/10/14 14:28
 * @Version 0.001
 */
@RestController
@RequestMapping("inhabitant")
public class InhabitantController {

    @Autowired
    private InhabitantService inhabitantService;

    /**
    * @Author: binzi
    * @Description:查询居民表
    * @Date: 2022/10/16 19:42
    * @Return:
    **/
    @RequestMapping("findInhabitant")
    public Map findInhabitant(InhabitantBean bean){
        return inhabitantService.findInhabitant(bean);
    }

    /**
    * @Author: binzi
    * @Description:根据Id查下居民表的数据
    * @Date: 2022/10/17 9:37
    * @Return: com.jk.pojo.InhabitantBean
    **/
    @RequestMapping("findInhabitantById")
    public InhabitantBean findInhabitantById(Integer id){
        return inhabitantService.findInhabitantById(id);
    }


    /**
    * @Author: binzi
    * @Description:查询当前时间的前七点数据
    * @Date: 2022/10/17 19:57
    * @Return: java.util.Map
    **/
    @RequestMapping("findInhabitantByWeek")
    public Map findInhabitantByWeek(){
        return inhabitantService.findInhabitantByWeek();
    }

    /**
    * @Author: binzi
    * @Description:查询各种病的总数
    * @Date: 2022/10/18 9:44
    * @Return: java.util.Map
    **/
    @RequestMapping("findInhabitantByResidentLabelCount")
    public Map findInhabitantByResidentLabelCount(){
        return inhabitantService.findInhabitantByResidentLabelCount();
    }

    /**
    * @Author: binzi
    * @Description:居民总数量
    * @Date: 2022/10/18 10:01
    * @Return: java.util.Map
    **/
    @RequestMapping("findByCountId")
    public Integer findByCountId(){
        return inhabitantService.findByCountId();
    }

    /**
    * @Author: binzi
    * @Description:签约居民数量
    * @Date: 2022/10/18 10:10
    * @Return: java.util.Map
    **/
    @RequestMapping("findByStatusCount")
    public Integer findByStatusCount(){
        return inhabitantService.findByStatusCount();
    }

    /**
    * @Author: binzi
    * @Description:统计三个团队本周已签约的数据
    * @Date: 2022/10/18 15:29
    * @Return: java.util.Map
    **/
    @RequestMapping("findInhabitantByDateCount")
    public Map findInhabitantByDateCount(){
        return inhabitantService.findInhabitantByDateCount();
    }

}
